<%@page import="com.person.pojo.AdminJudgeInfos"%>
<%@page import="com.person.bean.AdminJudgeInfo"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
	//获取登录标记
	Object loggedFlag = request.getSession().getAttribute("loggedFlag");
	if(loggedFlag == null){
		request.getSession().setAttribute("loggedFlag", 0);	//标记为未登陆
		loggedFlag = request.getSession().getAttribute("loggedFlag");//更新标记
	}
%>
<c:if test="${loggedFlag == 0 || loggedFlag == 3}">
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>管理员登录</title>
    <link rel="stylesheet" href="/PersonalBlog/backManaSyst/css/login.css">
    <link rel="stylesheet" href="/PersonalBlog/backManaSyst/css/tip.css">
</head>
<body>
	<c:if test="${loggedFlag == 3}">
		<div class="loginTip" style="display: none">
	       <div>
	           <i class="iconfont icondenglu-tishi"></i>
	           <span>请先登录后操作！</span>
	       </div>
	    </div>
	    <script>
	        function method(){
	            var loginTip = document.querySelector(".loginTip");
	            loginTip.style.display = "block";
	        }
	
	        function clearTime(){
	            var loginTip = document.querySelector(".loginTip");
	            loginTip.style.display = "none";
	        }
	
	        var timeId = window.setTimeout("method()",500);　　//定时执行，还可以这么写var timeId = window.setTimeout(method,1000);
	
	        var timeId = window.setTimeout("clearTime()",3000);
	    </script>
	</c:if>

    <div id="total">
        <h1>Admin</h1>
        <div class="body">
            <form action="/PersonalBlog/AdminJudge" method="post">
                <div>
                    <div>账号<i class="iconfont iconguanliyuan"></i></div><input type="text" name="account" class="input">
                    <span><i class=""></i><span></span></span>
                </div>
                <div>
                    <div>密码<i class="iconfont iconmima"></i></div><input type="password" name="password" class="input">
                    <span><i></i><span></span></span>
                </div>
                <div></div>
                <div class="contrs">
                    <input type="submit" value="登录" class="submit"> <input type="reset" value="重置">
                </div>
            </form>
        </div>
    </div>
    <script src="/PersonalBlog/backManaSyst/js/login.js"></script>
</body>
</html>
</c:if>

<%
	if((int)loggedFlag == 1){//如果已登录，跳转至主页
		response.sendRedirect("/PersonalBlog/backManaSyst/index.jsp");
	}
%>